<?php
header('Content-Type: text/html; charset=utf-8');
	include_once ('../connexpdo.php'); // pour inclure nos classes
	global $connexion;
	$requete='SELECT nom, lat, lng, CONCAT(Nvoie," ", Lvoie," ", CP," ",Ville," ",PAYS) as adresse FROM cabinet WHERE Lvoie<>""';
	$data=$connexion->query($requete);
	$rows = array();
	while ($r = $data->fetch(PDO::FETCH_ASSOC)) {
		$rows[] =  array("coordonnees"=>array("lat"=>( float ) $r['lat'], "lng"=>( float ) $r["lng"]), "info"=>$r['nom'].'<br>'.$r['adresse']);
	}
	echo $Json=json_encode($rows);
	
	function utf8_encode_array($array) {
		return utf8_encode($array);
	}
?>